home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
03
/
8
/
DISK0386.ZIP
/
TECO.ARC
/
LINE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1986-07-15
|
649b
|
30 lines
#include <ctype.h>
#include <stdio.h>
#include <string.h>
line()
{
#include "teco.h"
int iter; /* Iteration < > count */
if (number < 1) while (1) { /* Position back */
if (!bufptx) return; /* ...all done */
if (toascii(buffer[bufptx--]) == 13) {
if (! number++) { /* Start new line *
++bufptx;
if (toascii(buffer[bufptx+1]) == 10) {
++bufptx;
}
return;
}
}
}
if (number > 0) while (1) { /* Position front */
if (bufptx+1 >= bufptr) return;
if (toascii(buffer[++bufptx]) == 13) {
if (toascii(buffer[bufptx+1]) == 10) ++bufptx;
if (! --number) return;
}
}
}